package so.sao.code.service.infrastructure.enums;

import so.sao.top.core.util.enums.NamedEnumEntity;

/**
 * Created by Administrator on 2017/6/28.
 */
public enum TagBatchStatus implements NamedEnumEntity<Integer> {
    UNACTIVATE(10, "未激活"), PORTION_ACTIVATE(20, "部分激活"), ACTIVATED(30, "已激活");

    private Integer value;

    private String name;

    TagBatchStatus(Integer value, String name) {
	this.name = name;
	this.value = value;
    }

    @Override
    public Integer getValue() {
	return value;
    }

    @Override
    public String getName() {
	return name;
    }

	public static TagBatchStatus fromValue(Integer value) {
		switch (value) {
		case 10:
			return TagBatchStatus.UNACTIVATE;
		case 20:
			return TagBatchStatus.PORTION_ACTIVATE;
		case 30:
			return TagBatchStatus.ACTIVATED;
		default:
			throw new IllegalArgumentException("Value [" + value + "] not support!");
		}
	}
}
